import Vue from 'vue'
import App from './App'
import Emui from './emui'
import Theme from './emui/common/theme'
import ThemeConfig from './theme/config'
import Store from './store'
import Api from './common/js/api'
import Util from './common/js/util'
import http_v1 from './common/http.js'
import Methods from './common/methods.js';
import * as Utils from './common/utils'
// #ifdef MP-WEIXIN
import share from "./common/share.js"//全局分享小程序
Vue.mixin(share)
// #endif

//当前为演示版本，完整版加微信：cwapps
import * as action from "./common/action.js"
uni.$action = action

// #ifdef H5
import VConsole from 'vconsole'
new VConsole() 
// #endif

//全局取消
//console.log("process.env.NODE_ENV ",process.env.NODE_ENV )
if (process.env.NODE_ENV != 'development') {
	//console.log = () => {}
}

Vue.config.productionTip = false

Vue.use(Emui) // 安装emui库
Vue.use(Theme, ThemeConfig) // 安装并使用主题配置

Vue.prototype.$store = Store

uni.$http = http_v1 
uni.$utils = Utils 
//Vue.mixin(Methods)

// 监听窗体变化
uni.onWindowResize(res => {
  Store.dispatch('updateSystemInfo')
})
Vue.prototype.$api = Api
Vue.prototype.$switchTab = Util.switchTab

App.mpType = 'app'
const app = new Vue({
  ...App
})

app.$mount()
